package ast.exp;

import icg.EQTemp;
import ast.Node;
import ast.stmt.ProcStmt;
import ast.stmt.Statement;
import ast.type.Type;

public class ProcExp extends Expression {
	private ProcStmt stmt;

	public ProcExp(Statement stmt) {
		this.stmt = (ProcStmt) stmt;
	}

	@Override
	public String toString() {
		return stmt.toString();
	}

	@Override
	public Type typeCheck() {
		
		type = Node.st.getInfo(stmt.getId()).getType();
		stmt.typeCheck(type);
		return type;
	}

	@Override
	public void genCode() {
		stmt.setFalseL(falseL);
		stmt.setTrueL(trueL);
		stmt.genCode();
		this.addr = new EQTemp();
	}
}
